package com.isman.placeslist;

import com.isman.placeslist.adapter.PeopleAdapter;
import com.isman.placeslist.database.PeopleContent;

import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ListView;

public class TabPeopleList extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tab_people_list);
		init();
		initData();
	}

	private void init() {
		vList = (ListView) findViewById(R.id.lvw_people_list);
	}

	private void initData() {
		ContentResolver mContentResolver = getContentResolver();
		Cursor cursor = mContentResolver.query(PeopleContent.CONTENT_URI, null,
				PeopleContent.PSTATUS + "=3", null, PeopleContent.UNAME
						+ " ASC");
		if (cursor != null) {
			PeopleAdapter autoComplate = new PeopleAdapter(this, cursor);
			vList.setAdapter(autoComplate);
		}
	}

	private ListView vList;
}
